%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/v4/composite_domains"
    Bucket0("Bucket 0 (root)<br /><br />1: 67, 71<br />ᐳ: 9, 10, 32, 46, 59, 11<br />2: PgSelect[8]<br />ᐳ: Access[68], Access[72]<br />3: Connection[12]<br />4: ConnectionItems[14]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 12, 14, 68, 72, 11, 46, 59<br /><br />ROOT Connectionᐸ8ᐳ[12]"):::bucket
    Bucket3("Bucket 3 (listItem)<br />Deps: 68, 72, 11, 46, 59<br /><br />ROOT __Item{3}ᐸ14ᐳ[17]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 18, 68, 72, 17, 11, 46, 59<br /><br />ROOT PgSelectSingle{3}ᐸpostsᐳ[18]<br />1: <br />ᐳ: 19, 20, 33, 69, 73, 70, 74<br />2: PgSelectRows[27], PgSelectRows[34]<br />ᐳ: 26, 28, 37, 38"):::bucket
    Bucket5("Bucket 5 (listItem)<br />Deps: 11, 59<br /><br />ROOT __Item{5}ᐸ34ᐳ[35]"):::bucket
    Bucket7("Bucket 7 (listItem)<br />Deps: 11, 46<br /><br />ROOT __Item{7}ᐸ38ᐳ[41]<br />1: PgSelect[42]<br />2: PgSelectRows[51]"):::bucket
    Bucket9("Bucket 9 (listItem)<br /><br />ROOT __Item{9}ᐸ51ᐳ[52]"):::bucket
    Bucket10("Bucket 10 (listItem)<br />Deps: 11, 59<br /><br />ROOT __Item{10}ᐸ48ᐳ[54]<br />1: PgSelect[55]<br />2: PgSelectRows[60]"):::bucket
    Bucket11("Bucket 11 (listItem)<br /><br />ROOT __Item{11}ᐸ60ᐳ[61]"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket3
    Bucket3 --> Bucket4
    Bucket4 --> Bucket5 & Bucket7
    Bucket5 --> Bucket10
    Bucket7 --> Bucket9
    Bucket10 --> Bucket11

    %% plan dependencies
    PgSelect8[["PgSelect[8∈0] ➊<br />ᐸpostsᐳ<br />More deps:<br />- Object[11]"]]:::plan
    PgSelectInlineApply67["PgSelectInlineApply[67∈0] ➊"]:::plan
    PgFromExpression32{{"PgFromExpression[32∈0] ➊"}}:::plan
    PgSelectInlineApply71["PgSelectInlineApply[71∈0] ➊"]:::plan
    PgSelectInlineApply67 & PgFromExpression32 & PgSelectInlineApply71 --> PgSelect8
    Object11{{"Object[11∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ<br />Dependents: 3"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access10{{"Access[10∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access9 & Access10 --> Object11
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access9
    __Value2 --> Access10
    Connection12[["Connection[12∈0] ➊<br />ᐸ8ᐳ"]]:::plan
    PgSelect8 --> Connection12
    ConnectionItems14[["ConnectionItems[14∈0] ➊"]]:::plan
    Connection12 --> ConnectionItems14
    Access68{{"Access[68∈0] ➊<br />ᐸ8.m.joinDetailsFor22ᐳ"}}:::plan
    PgSelect8 --> Access68
    Access72{{"Access[72∈0] ➊<br />ᐸ8.m.subqueryDetailsFor30ᐳ"}}:::plan
    PgSelect8 --> Access72
    PgFromExpression46{{"PgFromExpression[46∈0] ➊"}}:::plan
    PgFromExpression59{{"PgFromExpression[59∈0] ➊"}}:::plan
    __Item17[/"__Item[17∈3]<br />ᐸ14ᐳ"\]:::itemplan
    ConnectionItems14 ==> __Item17
    PgSelectSingle18{{"PgSelectSingle[18∈3]<br />ᐸpostsᐳ"}}:::plan
    __Item17 --> PgSelectSingle18
    List69{{"List[69∈4]<br />ᐸ68,18ᐳ"}}:::plan
    Access68 & PgSelectSingle18 --> List69
    List73{{"List[73∈4]<br />ᐸ72,17ᐳ"}}:::plan
    Access72 & __Item17 --> List73
    PgClassExpression19{{"PgClassExpression[19∈4]<br />ᐸ__posts__.”id”ᐳ"}}:::plan
    PgSelectSingle18 --> PgClassExpression19
    PgClassExpression20{{"PgClassExpression[20∈4]<br />ᐸ__posts__.”user_id”ᐳ"}}:::plan
    PgClassExpression19 o--o PgClassExpression20
    First26{{"First[26∈4]"}}:::plan
    PgSelectRows27[["PgSelectRows[27∈4]"]]:::plan
    PgSelectRows27 --> First26
    Lambda70{{"Lambda[70∈4]<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda70 --> PgSelectRows27
    PgSelectSingle28{{"PgSelectSingle[28∈4]<br />ᐸfrmcdc_userUpdateContentᐳ"}}:::plan
    First26 --> PgSelectSingle28
    PgClassExpression33{{"PgClassExpression[33∈4]<br />ᐸ__posts__.”created_at”ᐳ"}}:::plan
    PgClassExpression20 o--o PgClassExpression33
    PgSelectRows34[["PgSelectRows[34∈4]"]]:::plan
    Lambda74{{"Lambda[74∈4]<br />ᐸpgInlineViaSubqueryTransformᐳ"}}:::plan
    Lambda74 --> PgSelectRows34
    PgClassExpression37{{"PgClassExpression[37∈4]<br />ᐸ__frmcdc_u....”img_url”ᐳ"}}:::plan
    PgSelectSingle28 --> PgClassExpression37
    PgClassExpression38{{"PgClassExpression[38∈4]<br />ᐸ__frmcdc_u...__.”lines”ᐳ"}}:::plan
    PgSelectSingle28 --> PgClassExpression38
    List69 --> Lambda70
    List73 --> Lambda74
    __Item35[/"__Item[35∈5]<br />ᐸ34ᐳ"\]:::itemplan
    PgSelectRows34 ==> __Item35
    PgSelectSingle36{{"PgSelectSingle[36∈5]<br />ᐸfrmcdc_userUpdateContentᐳ"}}:::plan
    __Item35 --> PgSelectSingle36
    PgClassExpression47{{"PgClassExpression[47∈5]<br />ᐸ__frmcdc_u....”img_url”ᐳ"}}:::plan
    PgSelectSingle36 --> PgClassExpression47
    PgClassExpression48{{"PgClassExpression[48∈5]<br />ᐸ__frmcdc_u...__.”lines”ᐳ"}}:::plan
    PgSelectSingle36 --> PgClassExpression48
    PgSelect42[["PgSelect[42∈7]<br />ᐸfrmcdc_userUpdateContentLineNodeᐳ<br />More deps:<br />- Object[11]"]]:::plan
    __Item41[/"__Item[41∈7]<br />ᐸ38ᐳ"\]:::itemplan
    __Item41 & PgFromExpression46 --> PgSelect42
    PgClassExpression38 ==> __Item41
    PgSelectRows51[["PgSelectRows[51∈7]"]]:::plan
    PgSelect42 --> PgSelectRows51
    __Item52[/"__Item[52∈9]<br />ᐸ51ᐳ"\]:::itemplan
    PgSelectRows51 ==> __Item52
    PgSelectSingle53{{"PgSelectSingle[53∈9]<br />ᐸfrmcdc_userUpdateContentLineNodeᐳ"}}:::plan
    __Item52 --> PgSelectSingle53
    PgClassExpression63{{"PgClassExpression[63∈9]<br />ᐸ__frmcdc_u...node_type”ᐳ"}}:::plan
    PgSelectSingle53 --> PgClassExpression63
    PgClassExpression64{{"PgClassExpression[64∈9]<br />ᐸ__frmcdc_u...node_text”ᐳ"}}:::plan
    PgClassExpression63 o--o PgClassExpression64
    PgSelect55[["PgSelect[55∈10]<br />ᐸfrmcdc_userUpdateContentLineNodeᐳ<br />More deps:<br />- Object[11]"]]:::plan
    __Item54[/"__Item[54∈10]<br />ᐸ48ᐳ"\]:::itemplan
    __Item54 & PgFromExpression59 --> PgSelect55
    PgClassExpression48 ==> __Item54
    PgSelectRows60[["PgSelectRows[60∈10]"]]:::plan
    PgSelect55 --> PgSelectRows60
    __Item61[/"__Item[61∈11]<br />ᐸ60ᐳ"\]:::itemplan
    PgSelectRows60 ==> __Item61
    PgSelectSingle62{{"PgSelectSingle[62∈11]<br />ᐸfrmcdc_userUpdateContentLineNodeᐳ"}}:::plan
    __Item61 --> PgSelectSingle62
    PgClassExpression65{{"PgClassExpression[65∈11]<br />ᐸ__frmcdc_u...node_type”ᐳ"}}:::plan
    PgSelectSingle62 --> PgClassExpression65
    PgClassExpression66{{"PgClassExpression[66∈11]<br />ᐸ__frmcdc_u...node_text”ᐳ"}}:::plan
    PgClassExpression65 o--o PgClassExpression66

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect8,Access9,Access10,Object11,Connection12,ConnectionItems14,PgFromExpression32,PgFromExpression46,PgFromExpression59,PgSelectInlineApply67,Access68,PgSelectInlineApply71,Access72 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1
    classDef bucket3 stroke:#ffa500
    class Bucket3,__Item17,PgSelectSingle18 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,PgClassExpression19,PgClassExpression20,First26,PgSelectRows27,PgSelectSingle28,PgClassExpression33,PgSelectRows34,PgClassExpression37,PgClassExpression38,List69,Lambda70,List73,Lambda74 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5,__Item35,PgSelectSingle36,PgClassExpression47,PgClassExpression48 bucket5
    classDef bucket7 stroke:#808000
    class Bucket7,__Item41,PgSelect42,PgSelectRows51 bucket7
    classDef bucket9 stroke:#ff0000
    class Bucket9,__Item52,PgSelectSingle53,PgClassExpression63,PgClassExpression64 bucket9
    classDef bucket10 stroke:#ffff00
    class Bucket10,__Item54,PgSelect55,PgSelectRows60 bucket10
    classDef bucket11 stroke:#00ffff
    class Bucket11,__Item61,PgSelectSingle62,PgClassExpression65,PgClassExpression66 bucket11

